import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import ElementUI from 'element-plus'
import 'element-plus/theme-chalk/index.css'

router.beforeEach((to, from, next) => {
    let doctor = sessionStorage.getItem('doctor')
    if(!(to.path === '/' || to.path === '/login')) {
        if(doctor == null) {
            router.push('/login')
        }
    }
    next();
})

createApp(App).use(router).use(ElementUI).mount('#app')
